<link rel="Stylesheet" type="text/css" href="<?php echo $base_url?>style/css/jquery.jmodal.css" />
<script language="javascript" src="<?php echo $base_url?>style/js/BE/jquery.jmodal.js"></script>
<script>
	var js_url="<?php echo $base_url;?>";
	var link_page_name="<?php echo $link_page_name;?>";
	var js_pagetitle="<?php echo $page_title?>";
</script>
<script language="javascript" src="<?php echo $base_url;?>style/js/BE/admin_company.js"></script>
<br />

<!-- begin select date -->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $base_url?>style/js/BE/datepicker/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="<?php echo $base_url?>style/js/BE/datepicker/jsDatePick.min.1.3.js"></script>
<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"txt_create_date",
			dateFormat:"%Y-%m-%d",
			imgPath:"<?php echo $base_url?>style/js/BE/datepicker/img/",
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
		
		var msg = "<?php echo $msg;?>";
		if (msg != "")
			alert("<?php echo $msg;?>");		
	};
</script>
<!-- end   select date -->

<!-- begin search -->
<form name="trueform2" id="trueform2" method="POST" action="<?php echo $base_url;?>admin_company/search/" onSubmit="return submitSearch('<?php echo $base_url;?>admin_company/search/',1);">
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#3D84CC" style="margin:auto; line-height:20px;">
  <tr>
    <td width="18%" bgcolor="#FFFFFF" class="title2">
    Tiêu đề:&nbsp;
    <input type="text" name="txt_name" id="txt_name" style="width:250px;" class="text1" value="<?php if (isset($txt_name)) echo $txt_name;?>" maxlength="200" />     
    Ngày tạo:&nbsp;
    <input type="text" name="txt_create_date" id="txt_create_date" style="width:70px;" class="text1" value="<?php if (isset($txt_create_date)) echo $txt_create_date;?>" maxlength="20"/>     
    <input type="hidden" name="isPost" value="1">
    <input type="hidden" name="h_cur_page" id="h_cur_page" value="">
    <input type="submit" name="btn_Search" id="btn_Search" value="Tìm kiếm" style="width:70px;" class="button2" />  
    </td>
  </tr>
</table>
</form>
<!-- end   search -->
<div style="padding:12px;">Danh sách <?php echo $page_title;?>:</div>
<div id="div_ajax_content" style="padding:0; margin:0;">
<?php
	if (count($aCompany)>0){?>
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#3D84CC" style="margin:auto; line-height:20px;">
  <tr>
    <td width="3%" align="center" bgcolor="#3D84CC" class="title1">#</td>
    <td width="26%" align="center" bgcolor="#3D84CC" class="title1">Tên doanh nghiệp</td>
		<td width="39%" align="center" bgcolor="#3D84CC" class="title1">URL</td>
    <td width="16%" align="center" bgcolor="#3D84CC" class="title1">Thông tin khác</td>
		<td width="6%" align="center" bgcolor="#3D84CC" class="title1">Trạng thái</td>
    <td width="8%" align="center" bgcolor="#3D84CC" class="title1">Thao tác</td>    
  </tr>
<?php
		$i=1;
		$bgcolor="#FFFFFF";
		foreach($aCompany as $key=>$item):
			if ($i%2==0){$bgcolor="#EBF2F8";}else{$bgcolor="#FFFFFF";}
?>  
  <tr bgcolor="<?php echo $bgcolor;?>">
    <td width="3%" align="center" class="index" valign="top"><?php echo $i;?></td>
    <td width="26%" align="center" class="content" style="text-align:left;" valign="top">
    <?php 
			if (isset($txt_name) && $txt_name != "")
				echo str_ireplace($txt_name,"<span class='title8'>".$txt_name."</span>",$item->company_adv_name);
			else
				echo $item->company_adv_name;
		?>
    <br>
    <?php
			if (isset($item->img_thumb) && $item->img_thumb != "")
			{
		?>
    <a target="_new" href="<?php echo $base_url;?>style/<?php echo $item->img;?>" title="Click để xem hình lớn"><img src="<?php echo $base_url;?>style/<?php echo $item->img_thumb;?>" border="0" width="90"/></a>
    <?php
			}
		?>    
    </td>    
    <td width="39%" align="center" class="content" style="text-align:left;" valign="top">
    <?php echo $item->url;?></td>	
    <td width="16%" align="center" class="content" style="text-align:left;" valign="top">
    * Ngày tạo: <?php echo $item->create_date;?><br />
    * Người tạo: <span class="note"><?php echo $item->create_user;?></span>	
    </td>	    
    <td width="6%" align="center" class="content" style="text-align:center;" valign="top">
    <?php if ($item->status=="1") echo "Hiển thị"; else if ($item->status=="0") echo "Không hiển thị";
	?></td>	
    <td width="8%" class="content" style="text-align:center;" valign="top"><a href="<?php echo $base_url.$page_name;?>/company_editimages/<?php echo $item->company_adv_id;?>"><strong>Chỉnh sửa hình</strong></a> | <a href="<?php echo $base_url.$page_name;?>/company_edit/<?php echo $item->company_adv_id;?>">Chỉnh sửa</a> | <a href="javascript:void(0);" onclick="del(<?php echo $item->company_adv_id;?>)">Xóa</a></td>
  </tr>  
    <?php
				$i++;
      endforeach; 
    ?>  
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td style="text-align:center;">
      <?php	echo $paging;	?>     
    </td>
  </tr>
</table>
<input type="hidden" id="h_cur_page" value="<?php echo $cur_page;?>" />
<input type="hidden" id="h_Search" value="<?php echo "\$search";?>" />
</div>
<?php
} //if
else
{
?>
<table width="98%" border="0" cellpadding="0" cellspacing="1" style="margin:auto;">
  <tr>
  	<td style="text-align:center;" height="60px">Không tìm thấy thông tin.</td>
  </tr>
</table>  
<?php	
}
?>
<br /><br />
